package com.blueheart.easyexcel.user;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import lombok.extern.slf4j.Slf4j;

import java.util.LinkedList;
import java.util.List;

@Slf4j
public class UserInfoExcelHelper {


    public static void readUserInfo(String fileName){
        final List<UserInfoVO> users = new LinkedList<>();
        EasyExcel.read(fileName,UserInfoVO.class,new UserInfoReadListener(users))
            .autoCloseStream(true)
            .ignoreEmptyRow(true)
            .headRowNumber(2)
            .sheet()
            .doRead();
        users.stream().forEach(u -> {
            log.info("user:{}",u);
        });
    }

}
